package com.jier.admin.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.jier.admin.groupValidation.AddMenu;
import com.jier.admin.groupValidation.UpdateMenu;

import java.util.Date;
import javax.validation.constraints.*;

public class Menu {

    @NotNull(groups = {UpdateMenu.class},message = "id不能为空")
    private Integer menuId;

    @NotEmpty(groups = {AddMenu.class},message = "菜单名不能为空")
    private String menuName;

    @Null(groups = {UpdateMenu.class})
    private Integer parentId;

    @NotNull(groups = {AddMenu.class},message = "菜单排序不能为空")
    private Integer orderNum;
    @NotEmpty(groups = {AddMenu.class},message = "菜单路径url不能为空")
    private String url;
    @NotEmpty(groups = {AddMenu.class},message = "菜单种类不能为空")
    private String menuType;
    @NotEmpty(groups = {AddMenu.class},message = "是否可见属性不能为空")
    private String visible;
    @NotEmpty(groups = {AddMenu.class},message = "权限标识不能为空")
    private String perms;

    private String icon;
    @Null(groups = {UpdateMenu.class})
    private String createBy;
    @Null(groups = {UpdateMenu.class})
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    @Null(groups = {UpdateMenu.class})
    private String updateBy;

    @Null(groups = {UpdateMenu.class})
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    private String remark;

    public Integer getMenuId() {
        return menuId;
    }

    public void setMenuId(Integer menuId) {
        this.menuId = menuId;
    }

    public String getMenuName() {
        return menuName;
    }

    public void setMenuName(String menuName) {
        this.menuName = menuName == null ? null : menuName.trim();
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public Integer getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(Integer orderNum) {
        this.orderNum = orderNum;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url == null ? null : url.trim();
    }

    public String getMenuType() {
        return menuType;
    }

    public void setMenuType(String menuType) {
        this.menuType = menuType == null ? null : menuType.trim();
    }

    public String getVisible() {
        return visible;
    }

    public void setVisible(String visible) {
        this.visible = visible == null ? null : visible.trim();
    }

    public String getPerms() {
        return perms;
    }


    public void setPerms(String perms) {
        this.perms = perms == null ? null : perms.trim();
    }

    public String getIcon() {
        return icon;
    }

    public void setIcon(String icon) {
        this.icon = icon == null ? null : icon.trim();
    }

    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy == null ? null : createBy.trim();
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy == null ? null : updateBy.trim();
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark == null ? null : remark.trim();
    }
}